<?php /* TICKETSMITH $Id: post_ticket.php,v 1.15 2005/02/14 06:13:35 cyberhorse Exp $ */
##
##	Ticketsmith Post Ticket
##

if (!$canEdit) {
	$AppUI->setMsg('Access denied', UI_MSG_ERROR);
	$AppUI->redirect();
}


// setup the title block
$titleBlock = new CTitleBlock( 'Submit Trouble Ticket' );
$titleBlock->addButton( 'tickets list', 'index.php?m=ticketsmith' );
$titleBlock->show();

?>

<script language="javascript">
function submitIt() {
	var f = document.ticketform;
	var msg = '';
	if (f.name.value.length < 3) {
		msg += "\n- <?php echo $AppUI->_('a valid name'); ?>"
	}
	if (f.email.value.length < 3) {
		msg += "\n- <?php echo $AppUI->_('a valid email'); ?>";
	}
	if (f.subject.value.length < 3) {
		msg += "\n- <?php echo $AppUI->_('a valid subject'); ?>";
	}
	if (f.description.value.length < 3) {
		msg += "\n- <?php echo $AppUI->_('a valid description'); ?>";
	}

	if (msg.length < 1) {
		f.submit();
	} else {
		alert( "<?php echo $AppUI->_('ticketsmithValidDetail', UI_OUTPUT_JS); ?>:" + msg );
	}
}
</script>

<table width="100%" border="0" cellpadding="3" cellspacing="0" class="infopanel">
<form name="ticketform" action="?m=ticketsmith" method="post">
<input type="hidden" name="dosql" value="do_ticket_aed">

<tr>
	<th><img align="absmiddle" src="images/discuss.gif" border="0"/>&nbsp;<?php echo $AppUI->_('Trouble Details'); ?></th>
</tr>
<tr>
	<td style="padding: 8px">
		<input type="button" value="<?php echo $AppUI->_('submit'); ?>" onClick="submitIt()">
		<input type="button" value="<?php echo $AppUI->_('back'); ?>" onClick="history.back(-1);">
	</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="subinfopanel">
<tr>
	<td align="right"><b><?php echo $AppUI->_('Name'); ?></b>:</td>
	<td><input type="text" class="text" name="name" value="<?php echo $AppUI->user_first_name . ' ' . $AppUI->user_last_name; ?>" size="50" maxlength="255"></td>
</tr>
<tr>
	<td align="right"><b><?php echo $AppUI->_('E-Mail'); ?></b>:</td>
	<td><input type="text" class="text" name="email" value="<?php echo $AppUI->user_email; ?>" size=50 maxlength="50"></td>
</tr>
<tr>
	<td align="right"><b><?php echo $AppUI->_('Subject'); ?></b>:</td>
	<td><input type="text" class="text" name="subject" value="" size="50" maxlength="50"></td>
</tr>
<tr>
	<td align="right"><?php echo $AppUI->_('Priority'); ?>:</td>
	<td>
		<select name="priority" class="text">
			<option value="0"><?php echo $AppUI->_('Low'); ?>
			<option value="1" selected><?php echo $AppUI->_('Normal'); ?>
			<option value="2"><?php echo $AppUI->_('High'); ?>
			<option value="3"><?php echo $AppUI->_('Highest'); ?>
			<option value="4" style="font-weight: bold; color: red"><?php echo $AppUI->_('911'); ?> <?php echo $AppUI->_('Emergency'); ?></option>
		</select>
	</td>
</tr>
<TR>
	<td align="right" valign="top"><b><?php echo $AppUI->_('Description'); ?></b>:</td>
	<td valign="top">
		<textarea cols="70" rows="10" class="textarea" name="description"><?php echo @$crow["description"];?></textarea>
	</td>
</tr>
</form>
</table>
&nbsp;<br />&nbsp;<br />&nbsp;
